package com.hitqz.robot.biz.business.model;

import java.math.BigDecimal;

/**
 * @author xupkun
 * @date 2024/6/11
 */
public class Line {

    private double A;

    private double B;

    private double C;

    private Point startPos;

    private Point endPos;

    public Line() {

    }
    public Line(double x1, double y1, double x2, double y2) {
        this.A = new BigDecimal(y2 - y1).setScale(3,BigDecimal.ROUND_UP).floatValue();
        this.B = new BigDecimal(x1 - x2).setScale(3,BigDecimal.ROUND_UP).floatValue();
        this.C= new BigDecimal(y2 * (x1 - x2) - x2 * (y1 - y2)).setScale(3, BigDecimal.ROUND_UP).floatValue();
        this.startPos = new Point(x1, y1);
        this.endPos = new Point(x2, y2);
    }


    public double getA() {
        return A;
    }

    public void setA(double a) {
        A = a;
    }

    public double getB() {
        return B;
    }

    public void setB(double b) {
        B = b;
    }

    public double getC() {
        return C;
    }

    public void setC(double c) {
        C = c;
    }

    public Point getStartPos() {
        return startPos;
    }

    public void setStartPos(Point startPos) {
        this.startPos = startPos;
    }

    public Point getEndPos() {
        return endPos;
    }

    public void setEndPos(Point endPos) {
        this.endPos = endPos;
    }
}